<template>
  <icon-font :type="iconName" />
</template>
<script lang="ts">
  import { defineComponent } from 'vue';
  import { createFromIconfontCN } from '@ant-design/icons-vue';

  const IconFont = createFromIconfontCN({
    scriptUrl: '//at.alicdn.com/t/font_3156038_i5erwhsd04q.js',
  });
  export default defineComponent({
    components: {
      IconFont,
    },
    props: {
      name: {
        type: String,
        default: 'dashboard',
      },
    },
    setup(props) {
      const prefix = 'icon-';
      return {
        iconName: prefix + props.name,
      };
    },
  });
</script>
